#ifndef SKYROAD_MESSAGE_QUEUE_H_
#define SKYROAD_MESSAGE_QUEUE_H_

#include <list>
#include <boost/thread.hpp>
#include <skyroad/message/message.hpp>
#include <skyroad/detail/config.hpp>

using namespace std;
class SKYROAD_DECL message_queue 
{
public:
    message_queue();
    void push(message& msg);
    void wait(message& msg);
    size_t size();
    bool timeout(message& msg);	

    boost::mutex m_mutex;

    boost::condition_variable m_queue_not_empty;

    string m_name;

    list<message> m_queue;

    volatile long m_nwaiters;

    boost::thread m_watch_thread;
};

#endif